from sqlalchemy import Column, String, create_engine, BigInteger
from sqlalchemy.orm import sessionmaker, scoped_session
from sqlalchemy.ext.declarative import declarative_base

# 创建对象的基类:
Base = declarative_base()

engine = create_engine('mysql+mysqlconnector://root:password@localhost:3306/test')
# 创建DBSession类型:
DBSession = sessionmaker(bind=engine)
AdBrandAssetReadSession = scoped_session(sessionmaker())
AdBrandAssetWriteSession = scoped_session(sessionmaker())

class User(Base):
    # 表的名字:
    __tablename__ = 'user'
    # 表的结构:
    id = Column(String(20), primary_key=True)
    name = Column(String(20))

class Weather(Base):
    __tablename__ = 'weather'
    province = Column(String(20))
    parent_city = Column(String(20))
    max_temperature = Column(BigInteger())


